package cn.keduox.entity;


import cn.keduox.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 书本类
 */
@Table(name = "book")
public class Book implements Serializable{
    /**
     * 书本id
     */
    @Id(name = "id")
    @Column(name = "id")
    @OrderItem(name = "id")
    private String id;
    /**
     * 书本名称
     */
    @Column(name = "book_name")
    private String name;
    /**
     * 书本作者
     */
    @Column(name = "author")
    private String author;
    /**
     * 书本市场价
     */
    @Column(name = "market_price")
    private BigDecimal marketPrice;
    /**
     * 书本成本价
     */
    @Column(name = "cost_price")
    private BigDecimal costPrice;
    /**
     * 书本图片地址
     */
    @Column(name = "cover_url")
    private String coverUrl;
    /**
     * 书本评论数
     */
    @Column(name = "comment_num")
    private Integer comNum;
    /**
     * 书本的销售量
     */
    @Column(name = "sales")
    private Integer sales;
    /**
     * 书本出版时间
     */
    @Column(name = "press_time")
    private Timestamp pressTime;
    /**
     * 书本出版社ID
     */
    @Column(name = "press_id")
    private String pressId;
    /**
     * 书本页数
     */
    @Column(name = "pages")
    private Integer pages;
    /**
     * 用户评分
     */
    @Column(name = "score")
    private Integer score;
    /**
     * 书本版本信息id
     */
    @Column(name = "book_version_id")
    private String bookVersionId;
    /**
     * 创建人
     */
    @Column(name = "create_by")
    private String createBy;
    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Timestamp createTime;
    /**
     * 更新人
     */
    @Column(name = "update_by")
    private String updateBy;
    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Timestamp updateTime;
    /**
     *删除标记，0正常，1删除
     */
    @Column(name = "del_flag")
    private Integer deleteFlag;
    /**
     * 详情Id
     */
    @Column(name = "book_info_id")
    private String bookInfoId;
    /**
     * 文档Id
     */
    @Column(name = "book_txt_id")
    private String bookTxtId;
    /**
     * 售价区间
     */
    @Column(name = "section_id")
    private String sectionId;
    /**
     * 版本信息，外键
     */
    @Column(name = "type_id")
    @Key(farther = "book")
    private String typeId;

    /**
     * 出版社实体
     */
    @Entity(table = "press",field = "pressId",address = "cn.keduox.entity.Press",name = "press")
    private Press press;
    /**
     * 文档信息实体
     */
    @Entity(table = "book_txt",field = "bookTxtId",address = "cn.keduox.entity.BookTxt",name = "bookTxt")
    private BookTxt bookTxt;
    /**
     * 版本信息实体
     */
    @Entity(table = "book_version",field = "bookVersionId",address = "cn.keduox.entity.BookVersion",name = "bookVersion")
    private BookVersion bookVersion;
    /**
     * 其他信息实体
     */
    @Entity(table = "book_info",field = "bookInfoId",address = "cn.keduox.entity.BookInfo",name = "bookInfo")
    private BookInfo bookInfo;
    /**
     *评论集合
     */
    List<BookComment> bookCommentList=new ArrayList<>();

    private  SecondType secondType;



    public Book() {
    }

    public SecondType getSecondType() {
        return secondType;
    }

    public void setSecondType(SecondType secondType) {
        this.secondType = secondType;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public BigDecimal getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice) {
        this.marketPrice = marketPrice;
    }

    public BigDecimal getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(BigDecimal costPrice) {
        this.costPrice = costPrice;
    }

    public String getCoverUrl() {
        return coverUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = coverUrl;
    }

    public Integer getComNum() {
        return comNum;
    }

    public void setComNum(Integer comNum) {
        this.comNum = comNum;
    }

    public Integer getSales() {
        return sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public Timestamp getPressTime() {
        return pressTime;
    }

    public void setPressTime(Timestamp pressTime) {
        this.pressTime = pressTime;
    }

    public String getPressId() {
        return pressId;
    }

    public void setPressId(String pressId) {
        this.pressId = pressId;
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    public String getBookVersionId() {
        return bookVersionId;
    }

    public void setBookVersionId(String bookVersionId) {
        this.bookVersionId = bookVersionId;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public String getBookInfoId() {
        return bookInfoId;
    }

    public void setBookInfoId(String bookInfoId) {
        this.bookInfoId = bookInfoId;
    }

    public String getBookTxtId() {
        return bookTxtId;
    }

    public void setBookTxtId(String bookTxtId) {
        this.bookTxtId = bookTxtId;
    }

    public String getSectionId() {
        return sectionId;
    }

    public void setSectionId(String sectionId) {
        this.sectionId = sectionId;
    }

    public Press getPress() {
        return press;
    }

    public void setPress(Press press) {
        this.press = press;
    }

    public BookTxt getBookTxt() {
        return bookTxt;
    }

    public void setBookTxt(BookTxt bookTxt) {
        this.bookTxt = bookTxt;
    }

    public BookVersion getBookVersion() {
        return bookVersion;
    }

    public void setBookVersion(BookVersion bookVersion) {
        this.bookVersion = bookVersion;
    }

    public BookInfo getBookInfo() {
        return bookInfo;
    }

    public void setBookInfo(BookInfo bookInfo) {
        this.bookInfo = bookInfo;
    }

    public List<BookComment> getBookCommentList() {
        return bookCommentList;
    }

    public void setBookCommentList(List<BookComment> bookCommentList) {
        this.bookCommentList = bookCommentList;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

}
